package com.wx.chapter10.final_.innerclass;

/**
 * ClassName:AnonymousInnerClassDetail
 * Package :com.wx.chapter10.innerclass
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/6/11 - 14:22
 */
public class AnonymousInnerClassDetail {
    public static void main(String[] args) {

    }
}

class Outer05 {
    private int n1 = 99;

    private void f1() {
        Person person = new Person() {
            @Override
            public void hi() {
                System.out.println("匿名内部类重写了 hi 方法 n1=" + n1 +
                        "  外部内的 n1=" + Outer05.this.n1);
            }

            @Override
            public void ok(String str) {
                super.ok(str);
            }
        };
    }
}

class Person {
    public void hi() {
        System.out.println("Person hi()");
    }

    public void ok(String str) {
        System.out.println("Person ok()" + str);
    }
}